package com.jd.demo.jdk8.domain;

import java.util.Objects;

public class Phone {
    private String name;
    private String salePlatform;
    private Integer price;
    
    public Phone() {
    }
    
    public Phone(String name, String salePlatform, Integer price) {
        this.name = name;
        this.salePlatform = salePlatform;
        this.price = price;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getSalePlatform() {
        return salePlatform;
    }
    
    public void setSalePlatform(String salePlatform) {
        this.salePlatform = salePlatform;
    }
    
    public Integer getPrice() {
        return price;
    }
    
    public void setPrice(Integer price) {
        this.price = price;
    }
    
    @Override
    public String toString() {
        return "Phone{" + "name='" + name + '\'' + ", salePlatform='" + salePlatform + '\'' + ", price=" + price + '}';
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Phone phone = (Phone) o;
        return Objects.equals(name, phone.name) && Objects.equals(salePlatform, phone.salePlatform);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(name, salePlatform);
    }
}
